package com.situ.spring.circulardependency;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {


    @Test
    public void test1() {
        // 创建Spring容器，在xml中配置的bean都会new出对象放到Spring容器
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext1.xml");
        // 从Spring容器中根据名字取出指定new出来的对象
        ClassA classA = (ClassA) context.getBean("classA");
        ClassB classB = (ClassB) context.getBean("classB");
    }



}
